<template>
	<view class="filter-wrapper" @click.native="inputFilter">
			<view>
				<!-- <uni-card>筛选</uni-card> -->
				<button class="filterbutton">筛选</button>
				<!-- <text class="Fileter-point">筛选</text> -->
			</view>
		<uni-popup ref="filterpopup">
			<view class="dialog-wrapper">
				<text class="filter-content-title">筛选</text>
				<view class="uni-px-5 uni-pb-5">
					<view class="text">星数：{{JSON.stringify(radio1)}}</view>
					<uni-data-checkbox v-model="radio1" :localdata="star"></uni-data-checkbox>
				</view>
				<view class="uni-px-5 uni-pb-5">
					<view class="text">状态：{{JSON.stringify(radio2)}}</view>
					<uni-data-checkbox v-model="radio2" :localdata="status"></uni-data-checkbox>
				</view>
				<view class="uni-px-5 uni-pb-5">
					<view class="text">必做：{{JSON.stringify(radio3)}}</view>
					<uni-data-checkbox v-model="radio3" :localdata="must"></uni-data-checkbox>
				</view>
				<view class="btn-dock">
					<button class="send" @click="sendFilter">确定</button>
					<button class="back" @click="back">取消</button>
				</view>
			</view>
		</uni-popup>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				radio1: "",
				radio2: "",
				radio3: "",
				star: [{
					text: '1-3',
					value: "1-3"
				}, {
					text: '4-5',
					value: "4-5"
				},{
					text:'任意',
					value:""
				}],
				status: [{
					text: '未开始',
					value: "未开始"
				}, {
					text: '未完成',
					value: "未完成"
				}, {
					text: '已完成',
					value: "已完成"
				}, {
					text: '已截止',
					value: "已截止"
				}, {
					text: '已评分',
					value: "已评分"
				},{
					text:'任意',
					value:""
				}],
				must:[{
					text:'是',
					value: "是"
				},{
					text:'否',
					value:"否"
				},{
					text:'任意',
					value:""
				}],
			}
		},
		onReady() {},
		methods: {
			inputFilter() {
				this.$refs.filterpopup.open()
			},
			sendFilter() {
				this.$emit("filterItems", this.radio1, this.radio2, this.radio3);
				this.$refs.filterpopup.close()
			},
			back(){
				this.$refs.filterpopup.close()
			}
		}
	}
</script>
<style lang="scss">
	@import url("taskFilter.css");
</style>